<?php
/**
* Class and Function List:
* Function list:
* - Debug()
* - add()
*/
/*
* Created on Nov 1, 2006
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
define('OUPUT_FUNCTION_ECHO', 0);
define('OUPUT_FUNCTION_VAREXPORT', 1);
class Debug
{
    var $var_array = array();
    var $smarty = null;
    function Debug(&$smarty) 
    {
        $this->smarty = $smarty;

    }
    function add($obj, $fn = OUPUT_FUNCTION_VAREXPORT, $comment = '') 
    {
        $new_index = count($this->var_array);
        $this->var_array[$new_index]['COMMENT'] = ($comment == '') ? '&nbsp' : $comment;
        if ($fn == OUPUT_FUNCTION_ECHO) $this->var_array[$new_index]['VALUE'] = $obj;
        elseif ($fn == OUPUT_FUNCTION_VAREXPORT) $this->var_array[$new_index]['VALUE'] = '<pre>' . var_export($obj, true) . '</pre>';
        $this->smarty->assign('debug', $this->var_array);

    }
    /*
    function getDebugMessage()
    {
    if(strlen($this->str_output)>0)
    return $this->str_output;
    
    return FALSE;
    }
    */

}
?>
